﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EjotyI
{
    class Tokenizer
    {
        public int[] tokens;
        public Tokenizer(string[] input)
        {
            tokens = new int[input.Length];
            for (int a = 0; a<input.Length ; a++)
            {
                tokens[a] = createTokens(input[a]);
            }
        }
        int createTokens(string text)
        {
            switch (text)
            {
                //define tokens for numbers 0 to 31
                case "0":
                    return 0;
                case "1":
                    return 1;
                case "2":
                    return 2;
                case "3":
                    return 3;
                case "4":
                    return 4;
                case "5":
                    return 5;
                case "6":
                    return 6;
                case "7":
                    return 7;
                case "8":
                    return 8;
                case "9":
                    return 9;
                case "10":
                    return 10;
                case "11":
                    return 11;
                case "12":
                    return 12;
                case "13":
                    return 13;
                case "14":
                    return 14;
                case "15":
                    return 15;
                case "16":
                    return 16;
                case "17":
                    return 17;
                case "18":
                    return 18;
                case "19":
                    return 19;
                case "20":
                    return 20;
                case "21":
                    return 21;
                case "22":
                    return 22;
                case "23":
                    return 23;
                case "24":
                    return 24;
                case "25":
                    return 25;
                case "26":
                    return 26;
                case "27":
                    return 27;
                case "28":
                    return 28;
                case "29":
                    return 29;
                case "30":
                    return 30;
                case "31":
                    return 31;
                //define operaters tokens
                case "#":
                    return 32;
                case "$":
                    return 33;
                case "->":
                    return 34;
                case "*":
                    return 35;
                case "/":
                    return 36;
                case "+":
                    return 37;
                case "-":
                    return 38;
                case ">":
                    return 39;
                case "<":
                    return 40;
                case ">=":
                    return 41;
                case "<=":
                    return 42;
                case "=":
                    return 43;
                case "!=":
                    return 44;
                //define the keywords
                case "set":
                    return 45;
                case "if":
                    return 46;
                case "end":
                    return 47;
                case "cinput":
                    return 48;
                //not to be implemeneted AT THIS TIME
                case "sinput":
                    return 49;
                case "coutput":
                    return 50;
                case "soutput":
                    return 51;
                case "while":
                    return 52;
                case "ends":
                    return 55;
                //define comment features
                case "@":
                    return 53;
                //define primary declaration delimeter
                case ";":
                    return 54;
                //define invalid tokens
                default:
                    return 2000;
            }
        }
    }
}
